/*
 *  Multi2Sim
 *  Copyright (C) 2012  Rafael Ubal (ubal@ece.neu.edu)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <unistd.h>

#include "../include/CL/cl.h"
#include "api.h"


/* Error messages */

char *opencl_err_note =
	"\tThis error message is generated by the Multi2Sim OpenCL library linked with\n"
	"\tyour OpenCL host application.\n"
	"\tThis implementation only provides a subset of the OpenCL specification. Please\n"
	"\temail 'development@multi2sim.org' for further support.\n";

char *opencl_err_param_note =
	"\tThis error message is generated by the Multi2Sim OpenCL library linked with\n"
	"\tyour OpenCL host application. While a complete OpenCL implementation would\n"
	"\treturn an error code to your application, the Multi2Sim OpenCL library\n"
	"\twill make your program fail with an error code.\n";




/*
 * Public functions
 */

void *clGetExtensionFunctionAddress(
	const char *func_name)
{
	unsigned int sys_args[1];
	sys_args[0] = (unsigned int) func_name;
	return (void *) syscall(OPENCL_SYSCALL_CODE, OPENCL_FUNC_clGetExtensionFunctionAddress, sys_args);
}

